package com.kensure.shike.user.model;

import com.kensure.mycom.config.service.MyConfigService;
import com.kensure.shike.user.service.SKRoleService;

import co.kensure.frame.BaseInfo;
import co.kensure.mem.NumberUtils;

/**
 * 用户获取的收益
 * 
 * @author fankd created on 2018-9-2
 * @since
 */
public class SKUserShouYi extends BaseInfo {

	private static final long serialVersionUID = 3545276994084105527L;

	/***/
	private Long id;
	/** 昵称 */
	private String nickname;
	/**
	 * 邀请人
	 */
	private SKUser ref;
	/**
	 * 自己
	 */
	private SKUser user;
	/** 本周收益 */
	private Double benzhou;

	/** 本月收益 */
	private Double benyue;

	/** 累计收益 */
	private Double leiji;

	/** 成员数 */
	private Integer chengyuan;

	/** 会员数 */
	private Integer huiyuan;

	/** 会员级别 */
	private String levelCode;
	
	/** 是否商家,0是否，1是是 */
	private Integer isSJ;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public Double getBenzhou() {
		return benzhou;
	}

	public void setBenzhou(Double benzhou) {
		this.benzhou = benzhou;
	}

	public Double getBenyue() {
		return benyue;
	}

	public void setBenyue(Double benyue) {
		this.benyue = benyue;
	}

	public Double getLeiji() {
		return leiji;
	}

	public void setLeiji(Double leiji) {
		this.leiji = leiji;
	}

	public Integer getChengyuan() {
		return chengyuan;
	}

	public void setChengyuan(Integer chengyuan) {
		this.chengyuan = chengyuan;
	}

	public Integer getHuiyuan() {
		return huiyuan;
	}

	public void setHuiyuan(Integer huiyuan) {
		this.huiyuan = huiyuan;
	}

	public String getLevelCode() {
		return levelCode;
	}

	public void setLevelCode(String levelCode) {
		this.levelCode = levelCode;
	}
	
	public String getLevelCodeDesc() {
		String des = "非会员";		
		if(levelCode != null){
			SKRole role = SKRoleService.selectRoleByCode(levelCode);
			if(role != null){
				des = role.getName();
			}
		}
		return des;
	}
	
	public int getNextNum() {
		int i = -99;	
		if(levelCode != null){
			if("0001".equalsIgnoreCase(levelCode)){
				i = NumberUtils.parseInteger(MyConfigService.getMyConfig("vip_huangjin").getVal(), -99);
			}else if("0002".equalsIgnoreCase(levelCode)){
				i = NumberUtils.parseInteger(MyConfigService.getMyConfig("vip_bojin").getVal(), -99);
			}
		}
		return i;
	}

	public SKUser getRef() {
		return ref;
	}

	public void setRef(SKUser ref) {
		this.ref = ref;
	}

	public SKUser getUser() {
		return user;
	}

	public void setUser(SKUser user) {
		this.user = user;
	}

	public Integer getIsSJ() {
		return isSJ;
	}

	public void setIsSJ(Integer isSJ) {
		this.isSJ = isSJ;
	}
	
	

}
